<template>
  <div>
    <el-pagination
      :total="routerData.total"
      :current-page="routerData.currentPage"
      :page-size="routerData.pageSize"
      :page-sizes="[5, 10, 20, 30, 50]"
      :pager-count="5"
      @current-change="handleCurrentChange"
      @size-change="handleSizeChange"
      background
      layout="total, sizes, prev, pager, next">
    </el-pagination>
  </div>
</template>

<script>

  export default {
    name: 'Pagination',
    components: {},
    props: {
      routerData: {
        type: Object,
        default: null
      }
    },
    data() { return {} },
    //计算属性，类似于data概念
    computed: {},
    //侦听器，监听data中的数据变化
    watch: {},
    //方法集合
    methods: {
      handleCurrentChange(val) {
        this.currentPage = val;
        this.getOrdersPages();
      },
      handleSizeChange(val) {
        this.pageSize = val;
      },
    },
    //生命周期 - 创建完成（可访问当前this实例）
    created() {},
    //生命周期 - 挂载完成（可访问DOM元素）
    mounted() {},
  }

</script>

<style >

</style>
